package com.hollysys.usersync.feign;


import com.alibaba.fastjson2.JSONObject;
import com.hollysys.usersync.entity.Response;
import com.hollysys.usersync.entity.platform.LoginRequest;
import feign.Headers;
import feign.Param;
import feign.RequestLine;
import org.springframework.validation.annotation.Validated;


/**
 * 系统管理服务接口
 *
 * @author Jeremy Yim
 * @date 2022-04-24
 */
@Validated
@Headers({"Content-Type: application/json", "Accept: application/json"})
public interface LoginServiceInvoker {

    /**
     * 登录
     *
     * @param appAccount 应用登录信息
     * @return 添加结果
     */
    @RequestLine("POST /auth/logins")
    JSONObject getCode(LoginRequest appAccount);

    /**
     * code换token
     *
     * @param code 授权code
     * @return token信息
     */
    @RequestLine("POST /auth/token?client_id=m7it&grant_type=authorization_code&code={code}")
    JSONObject getToken(@Param("code") String code);

}
